﻿using System;
using AcademicPlanner.Domain.Components;
using AcademicPlanner.Domain.Models;
using AcademicPlanner.Data;

namespace AcademicPlanner.Domain
{
	/// <summary>
	/// DomainMaster is the front controller singleton of the domain layer of the
	/// AcademicPlanner application.
	/// </summary>
	/// <version>1.0</version>
	/// <since>1.0</since>
	public class DomainMaster
	{
		/// <summary>
		/// Gets the <c>DataSourceAccessSupervisor</c> of the data layer.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		internal DataSourceAccessSupervisor DSAS { get { return DataSourceAccessSupervisor.GetInstance(); } }

		/// <summary>
		/// Gets the <c>AuthMngr</c> component of the AcademicPlanner application.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		public AuthMngr Auth { get { return AuthMngr.GetInstance(); } }

		/// <summary>
		/// Gets the <c>MembershipMngr</c> component of the AcademicPlanner application.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		public MembershipMngr Membership { get { return MembershipMngr.GetInstance(); } }

		/// <summary>
		/// Gets the <c>ModelsFountain</c> of the AcademicPlanner application.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		internal ModelsFountain ModelsFountain { get { return ModelsFountain.GetInstance(); } }

		/// <summary>
		/// Gets the <c>MainModel</c> of the AcademicPlanner application.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		internal MainModel MainModel { get { return MainModel.GetInstance(); } }


		private DomainMaster() 
		{
			
		}

		private class InstanceHolder 
		{
			internal static DomainMaster INSTANCE = new DomainMaster(); 
		}


		/// <summary>
		/// Gets the single DomainMaster instance.
		/// </summary>
		/// <returns>The single DomainMaster instance.</returns>
		/// <version>1.0</version>
		/// <since>1.0</since>
		public static DomainMaster GetInstance()
		{ 
			return InstanceHolder.INSTANCE; 
		}
	}
}
